import useNewFileNameFormStore from '@renderer/store/Form/NewFileNameFormStore'

// 新文件名
export default function useNewFileNameTransfer(
  callback: () => ITableDataItem[]
) {
  const newFileNameTransfer = () => {
    const { newFileName } = useNewFileNameFormStore()

    if (newFileName) {
      callback().forEach((item) => (item.newest.name = newFileName))
    }
  }

  return {
    newFileNameTransfer
  }
}
